import React from 'react'
import { UdDateRangePicker, UdForm } from '../../../../index'
import { message, Button } from 'antd'

const Demo = () => {
  return <UdForm items={[
    { label: '时间范围', id: ['begin', 'end'], render: <UdDateRangePicker /> },
  ]}
    onSubmit={submit}
    footer={
      <>
        <Button type="primary" htmlType="submit">提交</Button>
      </>
    }>
  </UdForm>
}

const submit = (value) => {
  message.success('开始时间为：' + value.begin + ' 结束时间为：' + value.end)
  console.log(value)
}

export default Demo
